(1) Field of the Invention
The present invention generally relates to a control system for controlling an auxiliary storage unit a cache storage unit and, more particularly, to a control system for controlling an auxiliary storage unit and a cache storage unit having a cache memory and a nonvolatile memory, which system being provided in a data processing system.
(2) Description of Related Art
A data processing system including a host computer, a cache storage unit having a cache memory, and an auxiliary storage unit (for example, a DASD (Direct Access Storage Device such as a disk unit)) has been proposed. In this data processing unit, when the cache memory has the same data as that in the auxiliary storage unit, the host computer reads out the data from the cache memory instead of the data from the auxiliary storage unit. In this case, since the auxiliary storage unit (such as the disk unit), which requires a long access time, is not accessed, the time required for obtaining the data can be decreased.
Alternatively, the data supplied from the host computer is written in the auxiliary storage unit in accordance with a data writing process which is often referred to as a write through process.
In the write through process, as shown in FIG. 1, when a host computer 31 supplies a writing instruction along with updated data to a disk controller 33, the disk controller 33 writes the updated data in both a cache memory 35 and an auxiliary storage unit 37 (a disk unit). This write through process has an advantage in that the data stored in the cache memory 35 is always the same as corresponding data stored in the auxiliary storage unit 37. However, as the time required for data writing depends on the access time of the auxiliary storage unit (the disk unit), the cache memory 35 can not be effectively used for the data writing.
To eliminate the above disadvantage of the write through process, a system having a nonvolatile memory has been proposed, as shown in FIG. 2. Referring to FIG. 2, the disk controller 41 includes a cache storage unit formed of the cache memory 35 and a nonvolatile memory 43. The capacity of the nonvolatile memory 43 is less than that of the cache memory 35. This system carries out a data writing process which is often referred to as a fast write process. In the fast write process, when the host computer 31 supplies the writing instruction along with the updated data to the disk controller 41, the disk controller 41 controls the cache storage unit so that the updated data is stored in both the cache memory 35 and the nonvolatile memory 43. After this, the disk controller 41 writes the updated data which has been stored in the nonvolatile memory 43 into the auxiliary storage unit 37 asynchronously with the writing instruction from the host computer 31. A process for writing the data stored in the nonvolatile memory 43 into the auxiliary memory 37 is referred to as a write back process. According to the fast write process, as the updated data is written in the nonvolatile memory 43, instead of the auxiliary storage unit 37, in response to the writing instruction from the host computer 31, the time required for the writing process based on the writing instruction is less than that required in the write through process described above. That is, the writing process can be carried out at a higher speed.
In the system having the nonvolatile memory 43, to effectively use the memories, a track on which data is stored is divided into N blocks, and data for every block can be written in and read out from the cache memory 35 and the nonvolatile memory 43. Thus, when the number of unused blocks in the nonvolatile memory 43 is less than N and the number of blocks corresponding to updated data supplied from the host computer 31 is greater than N, the data cannot be written in the nonvolatile memory 43. In this case, different writing processes are carried out based on whether or not the nonvolatile memory 43 has data on an identified track in the cache memory 35. That is, in a first process, when the nonvolatile memory 43 has no data on the identified track, the write data, corresponding to the identified track and supplied from the host computer 31 is written in the auxiliary storage memory 37 in accordance with the write through process described above. In the second process, to update data in the correct order in the auxiliary storage unit 37, when the nonvolatile memory 43 has the data on the identified track, the write data, corresponding to the identified track, supplied from the host computer 31 is written in the auxiliary storage unit 37 after the data which has been stored in the nonvolatile memory 43 is supplied to the auxiliary storage unit 37 and written in it. The second process described above is often referred to as a write back and write through process.
According to the conventional control system for controlling the cache storage unit including the nonvolatile memory, the write data supplied from the host computer will be always processed in accordance with the fast write process while the nonvolatile memory is in a state where the number of unused blocks in the nonvolatile memory is greater than the number of blocks corresponding to the data supplied from the host computer. Thus, in a state where the number of unused blocks in the nonvolatile memory 43 is small, the probability that the write data supplied from the host computer is processed in accordance with the write back and write through process increases. In the write back and write through process, the auxiliary storage unit is accessed two times, so that the time required for the write back and write through process is at least twice that required for the write through process.